package com.ktkj.init.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ktkj.init.dto.DictCondition;
import com.ktkj.init.dto.DictForm;
import com.ktkj.init.dto.DictListTreeCondition;
import com.ktkj.init.entity.Dict;
import com.ktkj.init.vo.QueryResult;
import com.ktkj.init.vo.TreeDataVo;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 字典表 服务类
 * </p>
 *
 * @author ktkj
 * @since 2020-09-23
 */
public interface DictService extends IService<Dict> {
    /**
     * 复合查询
     *
     * @param condition the condition
     * @return the query result
     * @author :yanlixiong
     * @date :2020-04-14 17:53:10
     */
    QueryResult<Dict> page(DictCondition condition);


    List<Dict> getDictDir();

    /**
     * Gets by type and p id.
     *
     * @param condition the condition
     * @return the by type and p id
     */
    List<Dict> getByTypeAndPId(DictCondition condition);

    /**
     * Gets by type and p id.
     *
     * @param condition the condition
     * @return the by type and p id
     */
    Dict getByTypeAndDescsAndPId(DictCondition condition);

    /**
     * Gets by type and p id.
     *
     * @param condition the condition
     * @return the by type and p id
     */
    Dict getByDescsAndPId(DictCondition condition);

    /**
     * Gets children list.
     *
     * @param dict the dict
     * @return the children list
     */
    Dict getChildrenList(Dict dict, String manageType);

    /**
     * Gets children list.
     *
     * @return the children list
     */
    Dict getParents(Dict dict);


    /**
     * Gets data.
     *
     * @param descs the descs
     * @param type  the type
     * @return the data
     * @author :yanlixiong
     * @date :2022-01-25 11:22:38
     */
    Dict getData(String descs, String type);

    /**
     * @param descs the descs
     * @return the data
     * @author :yanlixiong
     * @date :2022-01-25 11:22:38
     */
    Dict getByDescs(String descs);


    /**
     * 保存(增加/修改)
     *
     * @param form the form
     * @return the dict
     * @author :yanlixiong
     * @date :2020-04-14 17:53:10
     */
    Dict saveOrUpdate(DictForm form);

    /**
     * 批量导出.
     *
     * @author :yanlixiong
     * @date :2020-04-22 18:43:46
     */
    void batchExport(DictCondition condition, HttpServletResponse response);

    void removeJudge(List<Long> idList);


    /**
     * Insert test.
     *
     * @author :yanlixiong
     * @date :2021-12-06 14:11:11
     */
    void insertTest();

    /**
     * Update test.
     *
     * @author :yanlixiong
     * @date :2021-12-06 14:12:02
     */
    void updateTest();

    List<TreeDataVo> listTree(DictListTreeCondition condition);
}
